package cn.net.cfss.fgbp.api.console.inte;

import cn.net.cfss.fgbp.api.console.constant.Constants;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import cn.net.cfss.fgbp.api.console.dto.SysOrganDto;
import cn.net.cfss.fgbp.api.console.vo.SysOrganVo;
import cn.net.cfss.fgbp.base.page.PageData;

import java.util.List;

@FeignClient(name = Constants.SPI_SERVER_NAME)
@RequestMapping("sysOrganService")
public interface ISysOrganService {
	
    /**
     * 分页查询机构列表数据
     *
     * @param page
     * @return
     */
    @RequestMapping(value = "/pageData", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public PageData<SysOrganVo> pageData(@RequestBody PageData<SysOrganVo> page);

    /**
     * 机构树状数据一级列表
     *
     * @param
     * @return
     */
    @RequestMapping(value = "/pageOne", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public PageData<SysOrganVo> pageOne(@RequestBody PageData<SysOrganVo> page);

    /**
     * 机构树状数据一级列表
     *
     * @param
     * @return
     */
    @RequestMapping(value = "/listOne", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public List<SysOrganVo> listOne();

    /**
     * 查询机构列表
     * @param sysOrganVo
     * @return
     */
    @RequestMapping(value = "/list", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public List<SysOrganVo> list(@RequestBody SysOrganVo sysOrganVo);

    /**
     * 查询机构下级ID集合
     * @param id
     * @return
     */
    @RequestMapping(value = "/getIds", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public List<Long> getIds(@RequestParam("id") Long id);
    /**
     * 新增机构
     *
     * @param sysDepartmentDto
     * @return
     */
    @RequestMapping(value = "/save", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public SysOrganDto save(@RequestBody SysOrganDto sysDepartmentDto);

    /**
     * 修改机构
     *
     * @param sysDepartmentDto
     * @return
     */
    @RequestMapping(value = "/update", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public SysOrganDto update(@RequestBody SysOrganDto sysDepartmentDto);


    /**
     * 根据ID删除机构
     *
     * @param id
     * @return
     */
    @RequestMapping(value = "/delete", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public void delete(@RequestParam("id") Long id);


    /**
     * 根据ID查询机构
     *
     * @param 
     * @return
     */
    @RequestMapping(value = "/detail", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public SysOrganVo detail(@RequestParam("id") Long id);

    /**
     * 校验机构名称重复 修改接口
     *
     * @param
     * @return
     */
    @RequestMapping(value = "/checkUpdateOrganName", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public boolean checkUpdateOrganName(@RequestParam("organName") String organName ,@RequestParam("id") Long id);

    /**
     * 校验机构名称重复 新增接口
     *
     * @param
     * @return
     */
    @RequestMapping(value = "/checkAddOrganName", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public boolean checkAddOrganName(@RequestParam("organName") String organName);

    /**
     * 更新父节点的     是否节点标识
     *
     * @param id 删除的ID
     * @return
     */
    @RequestMapping(value = "/updateParentIsLeafNode", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public boolean updateParentIsLeafNode(@RequestParam("id")Long id);
}